<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<jsp:include page="../head.jsp">
	<jsp:param value="在职员工" name="title" />
</jsp:include>
</head>
<body>
	<div class="container">
		<div class="row">
			<div id="content" class="col-lg-12">
				<div class = "dao">	
					<a class="section" href = "manager">员工管理</a>
					<i class="right chevron icon divider"></i>
					<span class="active section">在职员工</span>												
				</div>
				
				<div class="row">
					<div class="col-md-12">
						<!-- BOX -->
						<div class="box border blue">
							<div class="box-title">
								<h4>员工列表</h4>
							</div>
							<div class="dataTables_header clearfix">
							   <div style = "padding: 10px">
							   <div class="ui buttons">
								<a href="employee/form" class="ui button"> <i class="icon user"></i>
									创建员工
								</a>
								<button class="ui blue button" id="delete">
									<i class="icon  trash"></i> 删除员工
								</button>
								</div>
							${error }
							<div class="searcher" style = "float:right;width:720px">
								<!-- <form style="width: 660px;"> -->
								<form class="form-horizontal" role="form">
									<div class="form-group">
										<div class="fields">
											
												<label>姓名</label> 
												<input type="text" name="userName" value="${param.userName }" style="padding-left: 12px;width: 126px;height:35px" placeholder="请输入姓名">
											
												<label>部门</label>
												<div class="ui selection dropdown">
													<input type="hidden" name="searchdept"
														value="${param.searchdept }"> <i class="dropdown icon"></i>
													<div class="default text">请选择部门</div>
													<div class="menu">
														<div class="item" data-value="">请选择部门</div>
														<c:forEach items="${deptList }" var="dept">
															<div class="item" data-value="${dept.dept_id }">${dept.dept_name }</div>
														</c:forEach>
												</div>
											</div>
												<label>职位</label>
												<div class="ui selection dropdown">
													<input type="hidden" name="searchpost"
														value="${param.searchpost }"> <i class="dropdown icon"></i>
													<div class="default text">请选择职位</div>
													<div class="menu">
														<div class="item" data-value="">请选择职位</div>
														<c:forEach items="${postList }" var="post">
															<div class="item" data-value="${post.postId }">${post.postName }</div>
														</c:forEach>
													</div>
											</div>
												<label>&nbsp;</label>
												<button class="ui submit button" style="width: 62px">检索</button>
										</div>
									</div>
								</form>
							</div>
				    </div>
				   </div>
				<div class="box-body center">
					<table id="datatable2" cellpadding="0" cellspacing="0" border="0" class="datatable table table-striped table-bordered table-hover">
						<thead >
							<tr style = "text-align: center">
								<th>
									<div >
										<input type="checkbox" id="checkAll"><label></label>
									</div>
								</th>
								<th>姓名</th>
								<th>性别</th>
								<th>地址</th>
								<th>电话</th>
								<th>邮箱</th>
								<th>部门</th>
								<th>职位</th>
								<th>状态</th>
								<th>编辑&nbsp;删除&nbsp;重置</th>
							</tr>
						</thead>
						<tbody>
							<c:forEach items="${empVoList }" var="empvo">
							<tr class="gradeX">
								<td >
									<div>
										<input class="item-check" type="checkbox"
											value="${empvo.empId }"><label></label>
									</div>
								</td>
								<td>${empvo.empName }</td>
								<td>${empvo.empGender }</td>
								<td>${empvo.empAddress }</td>
								<td>${empvo.empTelphone }</td>
								<td>${empvo.empEmail }</td>
								<td>${empvo.deptName }</td>
								<td>${empvo.postName }</td>
								<td>${empvo.empStatus }</td>
		
								<td><a
									href="employee/revise?id=${empvo.empId }"> <i
										class="icon edit"></i>
								</a>&nbsp;
								<a onclick="return confirm('确认删除？')"
									href="employee/empdelete?id=${empvo.empId }"> <i
										class="icon trash"></i> 
										</a>&nbsp;&nbsp;<a onclick="return confirm('确认重置？')" href="employee/changepassword?id=${empvo.empId }"><i class="privacy icon"></i></a></td>
									</tr>
								</c:forEach>
								</div>
							</div>
							<!-- /BOX -->
						</div>
					</div>
					<!-- /EXPORT TABLES -->
					
							<c:if test="${empty empVoList}">
								<tr>
									<td style="text-align: center;" colspan="10">暂无记录</td>
								</tr>
							</c:if>
						</tbody>
					</table>
					<c:if test="${totalPage > 1 }">
	
					<a
						<c:if test="${page!=1}">href="employee?page=1${queryString}"</c:if>
	
						class="${page == 1?'disable':''}">首页</a> <a
						<c:if test="${page!=1}">href="employee?page=${page-1}${queryString}"</c:if>
						class="${page == 1?'disable':''}">上一页</a> <a
						<c:if test="${page!=totalPage}">href="employee?page=${page+1 }${queryString}"</c:if>
						class="${page == totalPage?'disable':''}">下一页</a> <a
						<c:if test="${page!=totalPage}">href="employee?page=${totalPage }${queryString}"</c:if>
						class="${page == totalPage?'disable':''}">最后一页</a> 
						<span style = "float:right">${page}/${ totalPage} </span>							
						</c:if>
					</div>
			</div>
		</div>
	</div>
</div>
</body>
</html>